package com.itcast.UserServiceimpl;

import com.itcast.Usermapper.UserMapper;
import com.itcast.domain.User;
import com.itcast.userService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class UserServiceimpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User queryById(Long id) throws InterruptedException {
        Thread.sleep(new Random().nextInt(2000));
        return userMapper.selectByPrimaryKey(id);
    }
}
